﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Lister;
using NUnit.Framework;
using COFE.Core;

namespace COFE.Core.Entry
{
    public class SecondaryPropertyProviderManager : ISecondaryPropertyProviderManager
    {
        #region Constructor

        private static class PropProvider<T>
        {
            public static List<ISecondaryPropertyProvider<T>> SecondaryPropertyProviderList = new List<ISecondaryPropertyProvider<T>>();
        }

        static SecondaryPropertyProviderManager()
        {
            PropProvider<IFileSystemInfo>.SecondaryPropertyProviderList.Add(new CorePropertyProvider());
        }

        public SecondaryPropertyProviderManager()
        {
                        
        }

        #endregion

        #region Methods
      
        public List<ISecondaryPropertyProvider<T>> GetSecondaryPropertyProviders<T>()
        {
            return PropProvider<T>.SecondaryPropertyProviderList;
        }

        /// <summary>
        /// Register a property provider factory that create secondary property providers.
        /// </summary>
        /// <param name="factory"></param>
        public void Register<T>(ISecondaryPropertyProvider<T> propProvider)
        {            
            PropProvider<T>.SecondaryPropertyProviderList.Add(propProvider);
        }

        #endregion

        #region Data

        
        #endregion

        #region Public Properties

        public IUserProfile UserProfile { get; set; }
        
        #endregion

      
    }
}
